<%@page pageEncoding = "utf-8" contentType = "text/html;charset=utf-8"%>

<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>


<p>
  <a href="executorui?_action=dumb&_allTasks=true">Журнал задач</a><br>  
</p>

<h2>Задачи</h2>

<p>        
  <a href = "executorui?_action=displayTaskSearchForm">
    Поиск задач
  </a>
</p>

<table width="100%" cellpadding="10" cellspacing="10" style="font-size: 10px;">
  <c:forEach var = "task" items = "${tasksList}">           
    <tr class="marker" style="border-bottom: 1px #f1f1f1 solid;">
      <td><img src = "images/priority_item${task.priority}.gif"></td>
      <td>${task.id}</td>
      <td ${task.statusId == 3 ? 'style="text-decoration: line-through;"' : ''}>
        <c:out value="${task.name}"/>
      </td>
      <td><fmt:formatDate value="${task.startDate}" pattern="dd.MM.yyyy"/></td>      
      <td>                 
      <a style="background-color: transparent;" href = "${sessionScope.alias}?_action=taskDetails&task_id=${task.id}">
        <img border="0" src="images/desc.gif" alt="Детали" title="Детали">
      </a>
      </td>               
    </tr>
  </c:forEach>

  <c:if test="${fn:length(tasksList) == 0}">
     <tr><td align="center">Задач нет</td></tr>
  </c:if>
  
</table>

<p>
<ul class = "navbarpaging">
  <c:forEach var = "pagingLink" items = "${sidebarpaging}">
    <c:choose>
      <c:when test='${pagingLink.address == ""}'>
        <li><span class="currentpage">${pagingLink.text}</span></li>
      </c:when>
      <c:otherwise>
        <li><a href="${pagingLink.address}">${pagingLink.text}</a></li>
      </c:otherwise>     
    </c:choose>       
  </c:forEach>
</ul>
</p>